package org.ee.core.handler.exception;

import lombok.Getter;
import org.ee.core.constant.ResultCode;

/**
 * 自定义业务异常
 *
 * @Author jokr
 * @Date 2025/8/18 下午3:54
 */
@Getter
public class BusinessException extends RuntimeException {

    private final Integer code;


    public BusinessException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(ResultCode resultCode) {
        super(resultCode.getMessage());
        this.code = resultCode.getCode();
    }
}
